package gupao.concurrency.simpleweb;


import java.util.concurrent.TimeUnit;

public class Utils {
    public static void sleepIgnoreExp(long millis){
        try {
            TimeUnit.MILLISECONDS.sleep(millis);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }

    public static void waitMillis(long millis) {
        long start = System.currentTimeMillis();
        long end;
        long x = 0;
        long total = 1000 * 1000;
        do {
            if(x < total){
                x++;
            }
            end = System.currentTimeMillis();
        } while (start + millis >= end);
    }
}
